package com.youko.customerfrontstage.mapper;

import com.youko.customerfrontstage.bean.CommodityCategory;
import com.youko.customerfrontstage.bean.CommoditySpu;
import com.youko.customerfrontstage.bean.PageQuery;
import com.youko.customerfrontstage.dto.commodity.CommodityReturnDto;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface CommoditySpuMapper {
    /**
     * 通过id获取商品
     * @param id
     * @return
     */
    public CommoditySpu getCommoditySpuById(int id);

    /**
     * 获取所有的商品
     * @return
     */
    public List<CommoditySpu> getAllCommoditySpu();

    /**
     * 通过参数查询,筛选商品
     * @param pageQuery
     * @return
     */
    public List<CommoditySpu> getCommoditySpuList(PageQuery<CommoditySpu> pageQuery);

    /**
     * 添加商品
     * @param commoditySpu
     */
    public void addCommoditySpu(CommoditySpu commoditySpu);
    /**
     * 通过id删除商品
     * @param id
     */
    public void deleteCommoditySpuById(String id);
    /**
     * 更新商品
     * @param commoditySpu
     */
    public void updateCommoditySPuById(CommoditySpu commoditySpu);


    /**
     * 返回所有三级分类下的商品
     */
    List<CommoditySpu> selectAllByCategory(int categoryId);



}
